package com.market.web.model.domain;

import java.io.Serializable;

import com.market.domain.Location;
import com.market.domain.PickupSchedule;
import com.market.domain.transients.DAY_OF_WEEK;

public class PickupInfo implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6030849728655655021L;
	private String district;
	private String postCode;
	private String name;
	private String address;
	private String sunday;
	private String monday;
	private String tuesday;
	private String wednesday;
	private String thursday;
	private String friday;
	private String saturday;

	public PickupInfo(Location loc) {
		this.district = loc.getDistrict();
		this.postCode = loc.getPostCode();
		this.name = loc.getName();
		this.address = loc.getAddress();

		for (PickupSchedule schedule : loc.getPickupSchedules()) {

			switch (schedule.getDayOfWeek()) {
			case SUNDAY:
				if (schedule.getIsAvailable()) {
					this.sunday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			case MONDAY:
				if (schedule.getIsAvailable()) {
					this.monday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			case TUESDAY:
				if (schedule.getIsAvailable()) {
					this.tuesday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			case WEDNESDAY:
				if (schedule.getIsAvailable()) {
					this.wednesday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			case THURSDAY:
				if (schedule.getIsAvailable()) {
					this.thursday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			case FRIDAY:
				if (schedule.getIsAvailable()) {
					this.friday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			case SATURDAY:
				if (schedule.getIsAvailable()) {
					this.saturday = schedule.getBeginHour() + ":"
							+ schedule.getBeginMinute() + "-"
							+ schedule.getEndHour() + ":"
							+ schedule.getEndMinute();
				}
				break;
			}
		}
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getSunday() {
		return sunday;
	}

	public void setSunday(String sunday) {
		this.sunday = sunday;
	}

	public String getMonday() {
		return monday;
	}

	public void setMonday(String monday) {
		this.monday = monday;
	}

	public String getTuesday() {
		return tuesday;
	}

	public void setTuesday(String tuesday) {
		this.tuesday = tuesday;
	}

	public String getWednesday() {
		return wednesday;
	}

	public void setWednesday(String wednesday) {
		this.wednesday = wednesday;
	}

	public String getThursday() {
		return thursday;
	}

	public void setThursday(String thursday) {
		this.thursday = thursday;
	}

	public String getFriday() {
		return friday;
	}

	public void setFriday(String friday) {
		this.friday = friday;
	}

	public String getSaturday() {
		return saturday;
	}

	public void setSaturday(String saturday) {
		this.saturday = saturday;
	}

}
